<template>
    <div id="app" v-loading="loading">
        <div class="title">
                {{
                    last ? '上月' : '本月'
                    
                }}邀请榜
            <!-- <el-button class="f1" @click="handlePopShow">添加假用户</el-button> -->
            <a class="f1 changeType"
                @click="changeRank"
            >
                切换
                {{
                    last ? '本月' : '上月'
                    
                }}
            </a>
        </div>
        <el-table :data="tableData" border>
            <el-table-column prop="nick" label="昵称" :show-overflow-tooltip="true">
                <template slot-scope="scope">
                    <div class="userHead"
                        @click="navUserDetail(scope.row.user_id)"
                    >
                        <img :src="scope.row.avatar" class="square" />
                        {{
                            scope.row.name
                        }}
                    </div>
                </template>
            </el-table-column>
            <el-table-column prop="sort" label="排名" :show-overflow-tooltip="true">
                <template slot-scope="scope">
                    <div class="userHead">
                        {{
                            Number(scope.$index) + 1
                        }}
                    </div>
                </template>
            </el-table-column>
            <el-table-column prop="income" label="本月赚了" :show-overflow-tooltip="true">
            </el-table-column>
            <el-table-column prop="inviter_count" label="邀请人数" :show-overflow-tooltip="true"></el-table-column>
            <el-table-column prop="isTrue" label="是否系统账号" :show-overflow-tooltip="true">
                <template slot-scope="scope">
                    {{
                        scope.row.type == 1 ? '是' :  '否'
                    }}
                </template>
            </el-table-column>
            <el-table-column prop="btn" label="操作" :show-overflow-tooltip="true">
                <template slot-scope="scope">
                <div class="tableBtn">
                    <template v-if="scope.row.type  == 1">
                        <a @click="editUserWill(scope.$index)">修改</a>
                    </template>
                    <template v-else>-</template>
                </div>
                </template>
            </el-table-column>
        </el-table>
        <!-- <div class="paginationBlock">
            <el-pagination layout="prev, pager, next,total" :total="20" :page-size="10"></el-pagination>
        </div> -->

        <el-dialog title="提示" :visible.sync="handleShow" width="500px">
            <el-form label-position="top" class="form">
                <el-row :gutter="25">
                    <el-col :span="24">
                        <div class="grid-content bg-purple">
                            <el-form-item label="昵称">
                                <el-input
                                    v-model="virtualUser.user_name"
                                    disabled=""
                                ></el-input>
                            </el-form-item>
                        </div>
                    </el-col>
                    <el-col :span="24">
                        <div class="grid-content bg-purple">
                            <el-form-item label="添加邀请数量">
                                <el-input
                                    v-model="virtualUser.inviter_count"
                                    type="number"
                                ></el-input>
                            </el-form-item>
                        </div>
                    </el-col>
                    <el-col :span="24">
                        <div class="grid-content bg-purple">
                            <el-form-item label="添加收益">
                                <el-input
                                    v-model="virtualUser.income"
                                    type="number"
                                ></el-input>
                            </el-form-item>
                        </div>
                    </el-col>
                </el-row>
            </el-form>
            <span slot="footer" class="dialog-footer">
                <el-button @click="handlePopShow">取 消</el-button>
                <el-button type="primary" 
                    :loading="popBtnLoad"
                    @click="addUserWill"
                >确 定</el-button>
            </span>
        </el-dialog>
    </div>
</template>

<script>
    import InviteRank from './index.js';
    export default InviteRank;
</script>
<style lang="scss" scoped>
    .title {
        margin-bottom: 25px;
        font-size: 21px;
        margin-top: 65px;
    }
    .f1{
        float:right;
        margin-top:-10px;
    }
    .elupload{
        .head{
            display:block;
            width:70px;
            height:70px;
            border-radius:4px;
        }
    }
    .changeType{
        font-size:14px;
        line-height:40px;
        margin-right:35px;
        cursor: pointer;
    }
</style>